// 引入
import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter)
// 解决重复跳转同一个路由报错问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

// 全局注册路由
Vue.use(VueRouter)
// 定义路由规则
const routes = [{
    path: '/navBar',
    component: () => import('@/views/navBar'),
    // 二级路由
    children: [{
        path: 'msite',
        component: () => import("../views//msite.vue")
    }, {
        path: '/search',
        component: () => import("../views/search.vue")
    }, {
        path: '/order',
        component: () => import("../views/order.vue")
    }, {
        path: '/profile',
        component: () => import("../views/profile.vue")
    }]
},
{
    path: '/location',
    component: () => import('@/views/location')
}, {
    path: '/cityList',
    component: () => import('@/views/cityList')
},
{
    path: '/goods',
    component: () => import('../view/googslist.vue')


},
{
    path: '/personal',
    component: () => import('../view/personal.vue')
}

]
// 实例化路由
const router = new VueRouter({
    routes
})
// 导出路由
export default router





